package personal.vap.route.tracker.server;

import java.util.Date;
import java.util.List;

public class Route {
  
  public String name;
  public Date startTime;
  public Date endtime;
  public List<Coordinate> route;
  
  @Override
  public String toString() {
    return "Route [name=" + name + ", startTime=" + startTime + ", endtime=" + endtime + ", route=" + route + "]";
  }
  @Override
  public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((endtime == null) ? 0 : endtime.hashCode());
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    result = prime * result + ((route == null) ? 0 : route.hashCode());
    result = prime * result + ((startTime == null) ? 0 : startTime.hashCode());
    return result;
  }
  @Override
  public boolean equals(Object obj) {
    if (this == obj)
      return true;
    if (obj == null)
      return false;
    if (getClass() != obj.getClass())
      return false;
    Route other = (Route) obj;
    if (endtime == null) {
      if (other.endtime != null)
        return false;
    } else if (!endtime.equals(other.endtime))
      return false;
    if (name == null) {
      if (other.name != null)
        return false;
    } else if (!name.equals(other.name))
      return false;
    if (route == null) {
      if (other.route != null)
        return false;
    } else if (!route.equals(other.route))
      return false;
    if (startTime == null) {
      if (other.startTime != null)
        return false;
    } else if (!startTime.equals(other.startTime))
      return false;
    return true;
  }
  
}
